<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>{$title}</title>
<meta http-equiv="Content-Language" content="en-us"/>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
<meta name="resource-type" content="document"/>
<script type="text/javascript" src="{$TPLDIR}/js.js"></script>
<link rel="stylesheet" href="{$TPLDIR}/style.css" type="text/css"/>
<!--[if IE]>
<link rel="stylesheet" href="{$TPLDIR}/iehacks.css" type="text/css"/>
<![endif]--> 
<link rel="SHORTCUT ICON" href="favicon.ico" type="image/x-icon"/>
{if $rssurl neq "" }
<link rel="alternate" href="{$rssurl}" type="application/rss+xml" title="URD"/> 
{/if}
</head>
<body onload="javascript:init();">
{* popup_init src="$TPLDIR/overlib.js" <= No xhtml, fix manually:}
{* Default popup style is stored in overlib.js ... change it there! *}
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>
<div id="QuickMenu" class="QuickMenuHidden"></div>
<div id="QuickWindow" class="QuickWindowHidden"></div>
<script type="text/javascript" src="{$TPLDIR}/overlib.js"></script>

<div id="header">
    <a href="index.php"><img src="{$IMGDIR}/urdlogo.png" alt="Usenet Resource Downloader" class="urdlogo noborder" title="URD"/></a>
</div>
{strip}
<div id="table">
<span id="show_menu_div" class="{if $show_menu != 0}hidden{/if}"> 
    <img src="{$IMGDIR}/icon_windowsize.png" alt="" id="show_window" class="buttonlike" onclick="javascript:toggle_menu();" {popup text=$LN_showmenu } />
</span>
	<table class="menutable {if $show_menu == 0}hidden{/if}" id="menu_table">
		<tr class="menutrhide">
        <td class=" menutabgenhide" >
<span id="hide_menu_div" class="{if $show_menu == 0}hidden{/if} right"> 
    <img src="{$IMGDIR}/icon_windowsize.png" alt="" class="right buttonlike " id="hide_window" onclick="javascript:toggle_menu();" {popup text=$LN_hidemenu } />
</span>
    </td></tr>
	{counter start=0 skip=1 assign="offset"}
	{section name=x loop=$menu}
		<tr class="menutr">
		{assign var='mainmenuname' value=$menu[x]->name}
		{* 2 options, either 'mainmenuname = x' and 'subitemname = y' or 'mainmenuname = empty' and 'subitemname = menuname' *}
		{if $mainmenuname != ''}
			<td class="menutabwithsub menutabgen buttonlike" onmouseover="javascript:ShowSubMenu('{$offset}')">
			{$mainmenuname} &gt;
			</td>
		{/if}

		{* Each run is an array for a submenuitem, if $mainmenuname = '', then there's only 1 submenuitem which is mainmenuitem. *}
		{foreach key=link item=subitemname from=$menu[x]->items}
		{if $mainmenuname == ''}
			{assign var='mainmenuname' value=$subitemname}
			{assign var='mainmenulink' value=$link}
			<td class="menutab menutabgen buttonlike" onclick="javascript:document.location='{$mainmenulink}'" onmouseover="javascript:ShowSubMenu('none')">{$mainmenuname}</td>
		{/if}
		{/foreach}
		</tr>
		{counter}
	{/section}
	</table>
</div>
<div id="subtable">
	{counter start=0 skip=1 assign="offset"}
	{section name=x loop=$menu}
	{assign var='mainmenuname' value=$menu[x]->name}
	{if $mainmenuname != ''}
		{assign var='size' value=$menu[x]->count}
		{math equation="max (0,  z - y/2 + 1) " z=$offset y=$size assign="offset_2"}
		<table class="menutable hidden" id="submenu_{$offset}">
		{* Offset determines the number of empty TR's we lead with, to position the submenu's next to the main menu item: *}
		{section name=foo loop=$offset_2}
			<tr class="menutr"><td class="invisiblesubmenutab">&nbsp;</td></tr>
		{/section}	
		{foreach key=link item=subitemname from=$menu[x]->items}
			<tr class="menutr"><td class="submenutab menutabgen buttonlike" onclick="javascript:document.location='{$link}'">{$subitemname}</td></tr>
		{/foreach}
		</table>
	{/if}
	{counter}
	{/section}
</div>
{/strip}
<div id="urdstatus" class="statusminimized"></div>
<div id="contentout" onmouseover="javascript:ShowSubMenu('none');CloseQuickMenu();">
<div id="content">
